home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n07.arc / ATTRIB.TXT next >
Text File  |  1991-03-27  |  3KB  |  121 lines

  1. Sub MAIN
  2.  
  3. REM Check for attributes on. If on then turn them off. If none
  4. are REM enabled, then enter a user dialog to enable desired
  5. attributes.
  6.  
  7. REM Set Flags.
  8.  
  9. TRUE = 1
  10. OFF = 0
  11. Attribute = OFF
  12.  
  13. REM Check for Bold, Italic and Underline, then Superscript or
  14. Subscript.
  15.  
  16. If Bold() = TRUE Then
  17.      Attribute = TRUE
  18.      Bold OFF
  19. End If
  20. If Italic() = TRUE Then
  21.      Attribute = TRUE
  22.      Italic OFF
  23. End If
  24. If Underline() = TRUE Then
  25.      Attribute = TRUE
  26.      Underline OFF
  27. End If
  28. If SuperScript() = TRUE Then
  29.      Attribute = TRUE
  30.      Size = FontSize()
  31.      FontSize(Size + 2)
  32.      SuperScript OFF
  33. End If
  34. If SubScript() = TRUE Then
  35.      Attribute = TRUE
  36.      Size = FontSize()
  37.      FontSize(Size + 2)
  38.      SubScript OFF
  39. End If
  40.  
  41. REM If symbol font is active, return to Tms Rmn
  42.  
  43. If Font$() = "Symbol" Then
  44.      Attribute = TRUE
  45.      Font "Tms Rmn"
  46. End If
  47.  
  48. REM If any attributes on, then exit without any user interaction.
  49. Otherwise REM open a dialog box to permit the user to select the
  50. appropriate attributes.
  51.  
  52. If Attribute = OFF Then
  53.      GetUserInput
  54. Else
  55.      Print "Attributes returned to normal."
  56. End If
  57.  
  58. End Sub
  59.  
  60. REM Subroutine for user dialog bos.
  61.  
  62. Sub GetUserInput
  63.  
  64. TRUE = 1
  65. OFF = 0
  66.  
  67. REM Setup dialog box
  68.  
  69. Begin Dialog UserDialog 355, 120
  70.      Text 79, 2, 198, 12, "Select Text Attributes"
  71.      Text 15, 17, 90, 12,  "Attributes"
  72.      CheckBox 20, 37, 54, 12, "Bol&d", .Bld
  73.      CheckBox 20, 52, 81, 12, "&Italics", .Ital
  74.      CheckBox 20, 67, 99, 12, "&Underline", .Under
  75.      Text  117, 17, 54, 12, "Style"
  76.      OptionGroup .Styl
  77.           OptionButton 122, 37, 72, 12, "&Normal"
  78.           OptionButton 122, 52, 117, 12, "Su&perscript"
  79.           OptionButton 122, 67, 99, 12, "Su&bscript"
  80.      Text 242, 17, 45, 12, "Font"
  81.      OptionGroup .Fnt
  82.           OptionButton 247, 37, 99, 12, "&Unchanged"
  83.           OptionButton 247, 52, 81, 12, "&Tms Rmn"
  84.           OptionButton 247, 67, 72, 12, "&Symbol"
  85.      OKButton 86, 90, 64, 18
  86.      CancelButton 186, 90, 64, 18
  87. End Dialog
  88.  
  89. REM Do the interactions
  90.  
  91. Dim dlg As Dialog UserDialog
  92. Dialog dlg
  93.  
  94. REM Process the results
  95.  
  96. If dlg.Bld = 1 Then Bold TRUE
  97. If dlg.Ital = 1 Then Italic TRUE
  98. If dlg.Under = 1 Then Underline TRUE
  99. SuperScript OFF
  100. SubScript OFF
  101. If dlg.styl > 0 Then
  102.      If dlg.Styl = 1 Then
  103.           Size = FontSize()
  104.           FontSize(Size - 2)
  105.           SuperScript TRUE
  106.      Else
  107.           Size = FontSize()
  108.           FontSize(Size - 2)
  109.           SubScript TRUE
  110.      End If
  111. End If
  112. If dlg.Fnt > 0 Then
  113.      If dlg.Fnt = 1 Then
  114.           Font "Tms Rmn"
  115.      Else
  116.           Font "Symbol"
  117.      End If
  118. End If
  119.  
  120. End Sub
  121.